<extend name="./App/Common/View/default/Base/common.html" />
<block name="main_content">
    <include file="./App/Common/View/default/Public/crumb.html" />
    <div class="mod">
        <div class="mod-head">
            <h3>
                <ul class="nav nav-tabs">
                    <li class="">
                        <a href="{:U('picture')}">轮播图管理</a>
                    </li>
                    <li class="active">
                        <a href="javascript:void()">添加轮播图</a>
                    </li>
                </ul>
            </h3>
            
        </div>
        <style>
            .choose-box{
                position: absolute;
                top: -20%;
                left: -20%;
                display: block;
                width: 140%;
                height: 140%;
                margin: 0px;
                padding: 0px;
                background: rgb(255, 255, 255) none repeat scroll 0% 0%;
                border: 0px none; opacity: 0;
            }
           .list-items{
               margin-right: 20px;
           }
            .more-size{
                margin-bottom: 10px;
            }
            .form-group .col-sm-2{
                width:11%!important;
            }
            .form-group .col-sm-9{
                width:82%!important;
            }
            .col-sm-9 #edui1{
                width:100%!important;
            }
        </style>
        <div class="tab-content mod-content clearfix">
            <form action="{:U('pictureadd')}" method="POST" enctype="multipart/form-data">
                <div class="form-group clearfix" style="">
                    <label class="col-sm-2 col-xs-3 control-label clearfix" style="text-align: right">轮播链接：</label>
                    <div class="col-sm-9 col-xs-12">
                        <input required="" class="form-control" type='text' name="href">
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="col-sm-2 col-xs-3 control-label clearfix" style="text-align: right">选择图片：</label>
                    <div class="col-sm-9 col-xs-12" ng-invoker="context.bind();">
                        <div class="input-group ">
                            <input required="" name="url" class="form-control webuploader-input" value="" type="text">
                            <span class="input-group-btn">
                                <button class="btn btn-default webuploader-btn" type="button" data-toggle="modal" data-target="#modal-wechat-webuploader" style="height: 34px; width:100%;">选择图片</button>
                            </span>
                        </div>
                        <div class="input-group " style="margin-top:.5em;">
                            <img src="/Public/Mp/img/nopic.jpg" data-nopic="/Public/Mp/img/nopic.jpg" class="img-responsive img-thumbnail webuploader-picture" width="150">
                            <em class="close" style="position:absolute; top: 0px; right: -14px;" title="删除这张图片">×</em>
                        </div>
                    </div>
                </div>
                 <div class="form-group clearfix" style="">
                    <label class="col-sm-2 col-xs-3 control-label clearfix" style="text-align: right">轮播备注：</label>
                    <div class="col-sm-9 col-xs-12">
                        <!-- <input class="form-control" type='text' name="title"> -->
                        <textarea title="字数不能超过100字" class="form-control" name="name"></textarea>
                    </div>
                </div>
                    
                <div class="form-group clearfix" style="">
                    <label class="col-sm-2 col-xs-3 control-label clearfix" style="text-align: right">轮播排序：</label>
                    <div class="col-sm-9 col-xs-12">
                        <!-- <input class="form-control" type='text' name="title"> -->
                        <input required="" class="form-control" type='text' name="order" value="0">
                    </div>
                </div>
                <div class="form-group clearfix" style="text-align: center">
                    <input class="btn btn-primary" id="submit" value="确  认" type="submit">
                    <input class="btn btn-primary"  type="reset" value='重 置'/>
                </div>
            </form>
        </div>
    </div>
</block>
<block name="script">
    <script type="text/javascript">  
        var moreTypeChoose = $('#more-type-choose');
        moreTypeChoose.hide();
        $('.choose-box').on('ifChecked', function (e){
            var val = $(this).val();
            if(val == 1){
                moreTypeChoose.slideDown();
            }else{
                moreTypeChoose.slideUp();
            }

        });

        var choosePay = $('.choose-pay');
        choosePay.on('change',function(){

            var value = $(this).val();
            $('.choose-pay-type').hide();
            
                if(value != 1){
                    $('.zhf').show();
                    $('.dianlei').hide();
                }else{
                    $('.zhf').show();
                    $('.dianlei').show();
                }
                $(this).find('input[type="number"]').val("");
            
        })

        //优惠类型修改
        var cheapType = $('.cheaper-type');
        $('.che-type').on('change',function(){
            console.log($(this).val());

            if($(this).val() === '1'){

                cheapType.each(function(){
                    if($(this).attr('data-type') === 'dazhe'){
                        $(this).show();
                    }else {
                        $(this).hide();
                    }
                })
            }else {
                cheapType.each(function(){
                    if($(this).attr('data-type') === 'jiage'){
                        $(this).show();
                    }else {
                        $(this).hide();
                    }
                })
            }
        })

        $('.yhj').change(function(){
            var yj = $('.y_price').val();
            var zhk = $('.yhj').val();
            var zhh = yj*(zhk/10);
            $('.yhh').val(zhh); 
        });
    </script>
</block>